import ManageAPI from "@/api/manage";

export default (await import('vue')).defineComponent({
components: {
routerView,
avatar,
pageMain,
pageHeader,
pageDialog,
},

// 路由进入后钩子
created() {
let { userid } = this.$route.query;
this.userid = userid;
this.getUserInfo();
},
data() {
return {
userid: null,
userId: null,
userInfo: {},
};
},
methods: {
getUserInfo() {
ManageAPI.userInfo({
user: this.userid,
})
.then((res) => {
this.userInfo = res.userInfo;
})
.catch((err) => {
this.$message({
message: err.msg,
type: "error",
});
});
},
clickAvatar() {
console.log("点击了头像");
},
clickEditAvatar() {
console.log("点击了头像更换");
},
// 点击拉黑
clickToBlack() {
this.$confirm("确定拉黑该用户？", "拉黑用户", {
distinguishCancelAndClose: true,
confirmButtonText: "确定",
cancelButtonText: "取消",
}).then(() => {
this.$message({
type: "info",
message: "保存修改",
});
});
},
// 点击取消拉黑
clickCancelBlack() { },
// 点击限制
clickRestrict() { },
// 点击取消限制
clickCancelRestrict() { },
// 点击了删除
clickRemove() {
this.$confirm("确定删除该用户？", "删除用户", {
distinguishCancelAndClose: true,
confirmButtonText: "确定",
cancelButtonText: "取消",
}).then(() => {
this.$message({
type: "info",
message: "保存修改",
});
});
},
clickTabs(index) {
// 我的资料 0
// 密码管理 1
// 认证信息 2
// 我的地址 3
// 认证信息 4
// 行为日志 5
if (index == 0) {
this.$router.replace({
name: "userManagementInfoBase",
query: this.$route.query,
});
}

if (index == 1) {
this.$router.replace({
name: "userManagementInfoPassword",
query: this.$route.query,
});
}

if (index == 2) {
this.$router.replace({
name: "userManagementInfoReal",
query: this.$route.query,
});
}

if (index == 3) {
this.$router.replace({
name: "userManagementInfoAddress",
query: this.$route.query,
});
}

if (index == 4) {
this.$router.replace({
name: "userManagementInfoActive",
query: this.$route.query,
});
}

if (index == 6) {
this.$router.replace({
name: "userManagementInfoAuth",
query: this.$route.query,
});
}

if (index == 7) {
this.$router.replace({
name: "userManagementInfoDevice",
query: this.$route.query,
});
}

if (index == 8) {
this.$router.replace({
name: "userManagementInfoAuth",
query: this.$route.query,
});
}

if (index == 10) {
this.$router.replace({
name: "userManagementInfoSecret",
query: this.$route.query,
});
}

if (index == 11) {
this.$router.replace({
name: "userManagementInfoInviter",
query: this.$route.query,
});
}
},
},
});
